// import Cart from 'pages/Cart'
// import Home from 'pages/Home'
// import Mall from 'pages/Mall'
// import Setting from 'pages/Setting'
// 代码切割,按需加载
import homeheader from '@/components/Homeheader'
import mallheader from '@/components/Mallheader'
import cartheader from '@/components/Cartheader'
import settingheader from '@/components/Settingheader'
import homenav from '@/components/Homenav'
import Homepage1 from '@/components/Home/Homepage1'
import Homepage2 from '@/components/Home/Homepage2'
import Homepage3 from '@/components/Home/Homepage3'
import Homepage4 from '@/components/Home/Homepage4'
import Homepage5 from '@/components/Home/Homepage5'
import Pinlei from '@/components/Mall/pinlei'
import Pinpai from '@/components/Mall/pinpai'
import tuijian from '@/components/Mall/tuijian'
import xiangbao from '@/components/Mall/xiangbao'
import peishi from '@/components/Mall/peishi'
import xiexue from '@/components/Mall/xiexue'
import fuzhuang from '@/components/Mall/fuzhuang'
import shoushi from '@/components/Mall/shoushi'
import shoubiao from '@/components/Mall/shoubiao'
import meizhuang from '@/components/Mall/meizhuang'
import qiuxie from '@/components/Mall/qiuxie'
// 这个地方统一用按需加载？
const Mall = () => import('pages/Mall')
const Home = () => import('pages/Home')
const Cart = () => import('pages/Cart')
const Setting = () => import('pages/Setting')
const Prolist = () => import('pages/ProList')
const detail = () => import('pages/Detail')
const login = () => import('pages/Login')
const dingdan = () => import('pages/dingdan')
const tosetting = () => import('pages/tosetting')
const tabbar = () => import('@/components/tabbar')
// const confirmout = () => import('@/components/setting/confirmout')
const routes = [
  {
    path: '/tosetting',
    name: 'tosetting',
    component: tosetting
  },
  {
    path: '/dingdan',
    name: 'dingdan',
    component: dingdan
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/leilist',
    name: 'leilist',
    component: Prolist
  },
  {
    path: '/detail',
    name: 'detail',
    component: detail
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    text: '首页',
    name: 'home',
    components: {
      default: Home,
      homeheader,
      homenav,
      tabbar
    },
    isNav: true,
    iconf: '&#xe641',
    children: [
      {
        path: '/',
        redirect: 'tuijian'
      },
      {
        path: 'tuijian',
        component: Homepage1
      },
      {
        path: 'xiangbao',
        component: Homepage2
      },
      {
        path: 'shoushi',
        component: Homepage3
      },
      {
        path: 'shoubiao',
        component: Homepage4
      },
      {
        path: 'fuzhuang',
        component: Homepage5
      }
    ]
  },
  {
    path: '/mall',
    text: '分类',
    name: 'mall',
    components: {
      default: Mall,
      mallheader,
      tabbar
    },
    isNav: true,
    iconf: '&#xe659',
    children: [
      {
        path: '/',
        redirect: '/pinlei'
      },
      {
        path: '/pinlei',
        component: Pinlei,
        children: [
          {
            path: '/',
            redirect: '/list'
            // name: 'tuijian'
          },
          {
            path: '/list',
            name: 'tuijian',
            component: tuijian
            // children: [
            //   {
            //     path: 'list',
            //     name: 'leilist',
            //     component: Prolist
            //   }
            // ]
          },
          {
            path: 'list',
            name: 'xiangbao',
            component: xiangbao
          },
          {
            path: 'list',
            name: 'peishi',
            component: peishi
          },
          {
            path: 'list',
            name: 'xiexue',
            component: xiexue
          },
          {
            path: 'list',
            name: 'fuzhuang',
            component: fuzhuang
          },
          {
            path: 'list',
            name: 'shoushi',
            component: shoushi
          },
          {
            path: 'list',
            name: 'shoubiao',
            component: shoubiao
          },
          {
            path: 'list',
            name: 'meizhuang',
            component: meizhuang
          },
          {
            path: 'list',
            name: 'qiuxie',
            component: qiuxie
          }
        ]
      },
      {
        path: '/pinpai',
        component: Pinpai
      }
    ]
  },
  {
    path: '/cart',
    text: '购物车',
    name: 'cart',
    components: {
      default: Cart,
      cartheader,
      tabbar
    },
    meta: {
      isAuthRequired: true
    },
    isNav: true,
    iconf: '&#xe6e6'
  },
  {
    path: '/setting',
    text: '我的',
    name: 'setting',
    components: {
      default: Setting,
      settingheader,
      tabbar
    },
    isNav: true,
    iconf: '&#xe64a'
  },
  {
    path: '/prolist',
    text: '商品列表',
    // components: {
    //   default: Prolist,
    //   prolistheader
    // }
    component: Prolist
  }

]
export default routes
